// pages/regimental-commander/mycomponent/feedback-list/feedback-list.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: []
    },
    feedbacktype: {
      type: String,
      value: ''
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    feedbackNext: function(e) {
      const { item } = e.currentTarget.dataset
      if (item.children) {
        const params = {
          title: item.title,
          list: item.children
        }
        const str = JSON.stringify(params)
        wx.navigateTo({
          url: '/pages/regimental-commander/feedback-secondary/feedback-secondary?params=' + encodeURIComponent(str)
        })
      } else {
        const params = {
          type: item.title,
          title: this.data.feedbacktype || item.title
        }
        const str = JSON.stringify(params)
        wx.navigateTo({
          url: '/pages/regimental-commander/feedback-submit/feedback-submit?params=' + encodeURIComponent(str)
        })
      }
    }
  }
})
